package com.bhs.controller;

import com.bhs.pojo.Carousel;
import com.bhs.service.carousel.CarouselService;
import com.bhs.vo.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/resources")
@CrossOrigin
public class CarouselController {
    @Autowired
    private CarouselService carouselService;

    @PostMapping("/carousel")
    public ResponseData findCarousel() {
        List<Carousel> carouselList = carouselService.findCarousel();
        return ResponseData.success(carouselList);
    }
}
    